package com.mindskip.xzs.controller.admin;

import com.github.pagehelper.PageInfo;
import com.mindskip.xzs.domain.dto.admin.exampaperanswer.ExamPaperAnswerPageDTO;
import com.mindskip.xzs.domain.vo.admin.exampaperanswer.ExamPaperAnswerPageVO;
import com.mindskip.xzs.service.ExamPaperAnswerService;
import com.mindskip.xzs.utility.RestResponse;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("AdminExamPaperAnswerController")
@RequestMapping(value = "/api/admin/examPaperAnswer")
public class ExamPaperAnswerController {

    private final ExamPaperAnswerService examPaperAnswerService;

    public ExamPaperAnswerController(ExamPaperAnswerService examPaperAnswerService) {
        this.examPaperAnswerService = examPaperAnswerService;
    }

    @PostMapping("/page")
    public RestResponse<PageInfo<ExamPaperAnswerPageVO>> page(@RequestBody ExamPaperAnswerPageDTO examPaperAnswerPageDTO) {

        PageInfo<ExamPaperAnswerPageVO> examPaperAnswerByPage = examPaperAnswerService.getExamPaperAnswerByPage(examPaperAnswerPageDTO);

        return RestResponse.ok(examPaperAnswerByPage);
    }
}
